package cn.jiyun.controller;

import cn.jiyun.pojo.Employee;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.client.ServiceInstance;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.client.RestTemplate;

import java.util.List;

@RequestMapping("xiaofeizhe")
@Controller
public class EmployeeController {
    @Autowired
    private RestTemplate restTemplate;
    @RequestMapping("diaoyongTigongzhe")
    @ResponseBody
    public Employee getAll(){
        Employee forObject = restTemplate.getForObject("http://tigongzhe/tigongzhe/getAll", Employee.class);
        return forObject;
    }
}
